home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / nt_dsp1.lzh / NT_DSP1.MSA / LFLTS / LATIIR.ASM < prev    next >
Assembly Source File  |  1989-01-24  |  1KB  |  38 lines

  1. ;
  2. ; This program originally available on the Motorola DSP bulletin board.
  3. ; It is provided under a DISCLAMER OF WARRANTY available from
  4. ; Motorola DSP Operation, 6501 Wm. Cannon Drive W., Austin, Tx., 78735.
  5. ; Lattice IIR Filter Macro.
  6. ; Last Update 31 Jul 86   Version 1.0
  7. ;
  8. latiir  macro   order
  9. latiir  ident   1,0
  10. ;
  11. ;       Lattice IIR filter macro
  12. ;
  13. ;       Input value in register A, output value in register A
  14. ;
  15. ;       Macro call:
  16. ;               latiir  order           ;call macro
  17. ;
  18. ;       where 'order' is the number of reflections coefficients
  19. ;       in the filter.
  20. ;
  21. ;       Alters registers: x0 x1 y0 a b, r0 r4, pc sr
  22. ;
  23. ;       Uses 2 locations on stack
  24. ;
  25. ;
  26.   move            x:(r0)-,x0  y:(r4)+,y0    ;get first k, first state
  27.   macr  -x0,y0,a  x:(r0)-,x0  y:(r4)-,y0    ;do first section
  28.   do    #order-1,_endlat                    ;do remaining sections
  29.   macr  -x0,y0,a              b,y:(r4)+     ;a-k*s, save previous state
  30.   move  a,x1                  y:(r4)+,b     ;set a for mul, get st again
  31.   macr  x1,x0,b   x:(r0)-,x0  y:(r4)-,y0    ;fnd nxt s, nxt s, nxt k
  32. _endlat
  33.   move                        b,y:(r4)+     ;round; save second last state
  34.   move            x:(r0)+,x0  a,y:(r4)+     ;update r0, save last state
  35.   endm 
  36.